home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / bsd / m68k / cpu.h < prev    next >
Text File  |  1995-02-14  |  2KB  |  79 lines

  1. /*    @(#)cpu.h    1.0    11/09/86    (c) 1986 NeXT    */
  2.  
  3. /* 
  4.  * HISTORY
  5.  * 21-May-91  Gregg Kellogg (gk) at NeXT
  6.  *    Public version.
  7.  *
  8.  * 26-Mar-91  Gregg Kellogg (gk) at NeXT
  9.  *    Externallized all variable declarations.
  10.  *
  11.  * 09-Nov-86  John Seamons (jks) at NeXT
  12.  *    Ported to NeXT.
  13.  */ 
  14.  
  15. /*
  16.  * Copyright (c) 1982, 1986 Regents of the University of California.
  17.  * All rights reserved.  The Berkeley software License Agreement
  18.  * specifies the terms and conditions for redistribution.
  19.  *
  20.  *    @(#)cpu.h    7.1 (Berkeley) 6/5/86
  21.  */
  22. #ifndef    _M68K_CPU_
  23. #define    _M68K_CPU_
  24.  
  25. #ifndef    ASSEMBLER
  26. /* 
  27.  *  We use these types in the definitions below and hence ought to include them
  28.  *  directly to aid new callers (even if our caller is likely to have already
  29.  *  done so).
  30.  */
  31. #import <bsd/sys/types.h>
  32. #endif    ASSEMBLER
  33.  
  34. #ifndef    ASSEMBLER
  35. #ifdef    KERNEL_BUILD
  36. #import <cpus.h>
  37. #else    KERNEL_BUILD
  38. #import <mach/features.h>
  39. #endif    KERNEL_BUILD
  40. #endif    ASSEMBLER
  41.  
  42. /*
  43.  * Hardware revisions
  44.  */
  45. #if    KERNEL || STANDALONE
  46.  
  47. #ifndef    ASSEMBLER
  48. extern u_short    dma_chip;
  49. extern u_char    cpu_rev;
  50. extern u_char    cpu_clk;
  51. extern u_char    machine_type;            /* see scr.h for values */
  52. extern u_char    board_rev;
  53. extern u_char    cpu_type;
  54. extern u_char    mon_rev;
  55. #endif    ASSEMBLER
  56.  
  57. /* cpu_type values */
  58. #define    MC68030        0
  59. #define    MC68040        1
  60.  
  61. #endif    KERNEL || STANDALONE
  62.  
  63. #ifndef    ASSEMBLER
  64. #if    NCPUS > 1
  65. static inline int cpu_number(void)
  66. {
  67.     register ret;
  68.  
  69.     asm volatile ("movc    msp,%0" : "=da" (ret));
  70.     return (ret);
  71. }
  72. #else    NCPUS > 1
  73. #define    cpu_number()        (0)
  74. #endif    NCPUS > 1
  75. #endif    ASSEMBLER
  76.             
  77.  
  78. #endif    _M68K_CPU_
  79.